package com.coolingme.general;

/**
 * 责任链模式测试
 *
 * @author wangyue
 * @date 2020-09-23 21:07
 */
public class Test {

    public static void main(String[] args) {
        ConcreteHandlerA handlerA = new ConcreteHandlerA();
        ConcreteHandlerB handlerB = new ConcreteHandlerB();
        ConcreteHandlerC handlerC = new ConcreteHandlerC();

        // 设置责任链
        handlerA.setNextHandler(handlerB);
        handlerB.setNextHandler(handlerC);

        handlerA.handlerRequest("requestA");
        System.out.println("---------------");

        handlerA.handlerRequest("requestB");
        System.out.println("---------------");

        handlerA.handlerRequest("requestC");
    }

}
